package com.boco.blch.analysiser.compliance.HW.data;






import com.boco.blch.analysiser.compliance.ComplianceResolved;
import com.boco.blch.analysiser.util.XmlUtil;

/**
 * @author 黄戈
 * Hbase主备配置
 *
 */

public class BOCO_Hbase_HAManage_MasterSlave implements ComplianceResolved {
	private final static String HbaseP1 ="hbase.cluster.distributed";
	private final static String HbaseP2="hbase.zookeeper.quorum";
	private final static String HbaseP3="hbase.zookeeper.property.clientPort";

	@Override
	public int realEchoResolved(String echoResult) {
		if(!echoResult.equals("")&&echoResult!= null&&(!echoResult.contains(NoPermission1)&&!echoResult.contains(NoPermission2)&&!echoResult.contains(NoPermission3))){
		 String DataResult=echoResult;//.substring(echoResult.indexOf("Data-start")+"Data-start".length(),echoResult.indexOf("Data-end")).trim();
		 if(!DataResult.contains(NotFindFile)&&!DataResult.contains("boco-HBase-result:error")){
		String HbaseResult1=XmlUtil.getValueByName(DataResult,HbaseP1);
		String HbaseResult2=XmlUtil.getValueByName(DataResult,HbaseP2);
		String HbaseResult3=XmlUtil.getValueByName(DataResult,HbaseP3);
		if(HbaseResult1.equals("true")&&(!HbaseResult2.equals("")&&HbaseResult2!=null&&!HbaseResult2.equals("null"))&&(!HbaseResult3.equals("")&&HbaseResult3!=null&&!HbaseResult3.equals("null"))){
			System.out.println(111);
			return SUCCESS;
		}else{
			return FAILED;
		}
	
	  }else{
		  return FAILED;
	  }
		}else{
		return FAILED;	
		
		}
	}
	
	/*
*/

}
